TfrxDBDataset
|
TfrxUserDataset
Components for data access. The FastReport uses these components for navigation and reference to the data set fields. Both of the components have a general “TfrxDataSet” parent, from which they inherit most part of the functionality. The TfrxUserDataSet component allows constructing reports, which are not connected to the data from DB, but do receive data from other sources (for example, array, file, etc.). At the same time, a programmer should only provide navigation in such source. Data receiving is performed not via this component, but using other ways (for example, via the “TfrxReport.OnGetValue” event). The TfrxUserDataSet component has the following properties: property RecNo: Integer readonly; A current record number. The first record’s number is “0”. property Enabled: Boolean default True; Defines, whether the given component is available from the designer. property RangeBegin: TfrxRangeBegin default rbFirst; The navigation start point. The following values are available: rbFirst – from the beginning of the data rbCurrent – from the current record property RangeEnd: TfrxRangeEnd default reLast; The endpoint of navigation. The following values are available: reLast – till the end of the data reCurrent – till the current record reCount – by the number of records set in the “RangeEndCount” property property RangeEndCount: Integer; A number of records in the data set, if the “RangeEnd” property = reCount. property UserName: String; A symbolic name, under which the dataset will be displayed in the designer. property OnCheckEOF: TfrxCheckEOFEvent; TfrxCheckEOFEvent = procedure(Sender: TObject; var Eof: Boolean) of object; This event’s handler must return the Eof = True parameter, if the end of the data set is reached. property OnFirst: TNotifyEvent; This event’s handler must move the cursor to the beginning of the data set. property OnNext: TNotifyEvent; This event’s handler must move the cursor to the next record. property OnPrior: TNotifyEvent; This event’s handler must move the cursor to the previous record. The TfrxDBDataSet component is designed for connecting to the DB components, which are based on TDataSet, such as “TTable” and “TQuery.” Such functions as navigation in the data source and referring to fields are performed automatically, which means that a programmer does not have to worry about it. In addition to the abovedescribed properties, the component has the following ones: property CloseDataSource: Boolean default False; Close a data set after report construction is completed. property OpenDataSource: Boolean default True; Open a data set before report construction is started. property FieldAliases: TStrings; Symbolic names of data set fields. property DataSet: TDataSet; property DataSource: TDataSource; A link to a component of the TDataSet type or TDataSource, which is, in fact, a data set. property OnClose: TNotifyEvent; An event occurs when opening a data set. property OnOpen: TNotifyEvent; An event occurs when closing a data set. |